package com.beep.erp.model.login;

import com.beep.erp.Constants;
import com.beep.erp.common.base.BaseBean;
import com.beep.erp.common.bean.LoginBean;
import com.beep.erp.http.HttpRetrofit;
import com.beep.erp.http.RetryWhenNetworkException;

import rx.Observable;

/**
 * Created by jolly on 2018/8/24.
 */

public class LoginModel implements LoginContract.Model {

    @Override
    public Observable<LoginBean> login(String username, String pwd) {
        return HttpRetrofit.getInstance().apiService.login(username, pwd).compose(HttpRetrofit.toSubscribe()).compose(HttpRetrofit.toTransformer()).retryWhen(new RetryWhenNetworkException());
    }
}
